Release 10.1A: OpenEdge Development:
Web Services


Array mapping in WSDL documents

This section provides detailed information about how array parameters are represented in each of the three WSDL style/use formats:

The description of each WSDL format includes an example. The example shows the schema information in the types section, plus the message sections for request and response, for a 4GLprocedure with the following signature in the CustomerAO AppObject:

arraySample procedure signature
/* arraySample*/ 
DEFINE INPUT  PARAMETER names     AS CHARACTER EXTENT. 
DEFINE INPUT  PARAMETER hireDates AS DATETIME EXTENT. 
DEFINE OUTPUT PARAMETER quotas    AS INTEGER EXTENT 12. 

RPC/Encoded

For the RPC/Encoded format, an array parameter is represented as a SOAP array complexType in an XML Schema type definition, as shown:

Array parameter definition for RPC/Encoded WSDL
<complexType name="ArrayOfXMLType"> 
    <complexContent> 
        <restriction base="soapenc:Array"> 
            <attribute ref=soapenc:arrayType" wsdl:arrayType="XMLType[]"/> 
        </restriction> 
    <complexContent> 
</complexType> 

The WSDL file contains a separate schema for each object defined in ProxyGen. Each such schema includes one SOAP array complexType definition for each data type used as an array parameter for any procedure or function in that object. For example, if the 4GL defines one or more parameters in the object with the data type CHARACTER EXTENT, the schema includes a complexType named “ArrayOfString”.

The RPC/Encoded WSDL document for the arraySample procedure shown at the beginning of this section includes the following types and message sections:

RPC/Encoded WSDL schema example
<wsdl:types> 
    <schema targetNamespace="urn:tempuri-org:CustomerAO" 
            xmlns="http://www.w3.org/2001/XMLSchema" 
            elementFormDefault="unqualified"> 
        <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> 
        <complexType name="ArrayOfInt"> 
            <complexContent> 
                <restriction base="soapenc:Array"> 
                    <attribute ref="soapenc:arrayType" 
                               wsdl:arrayType="xsd:int[]"/> 
                </restriction> 
            </complexContent> 
        </complexType> 
        <complexType name="ArrayOfDateTime"> 
            <complexContent> 
                <restriction base="soapenc:Array"> 
                    <attribute ref="soapenc:arrayType" 
                               wsdl:arrayType="xsd:dateTime[]"/> 
                </restriction> 
            </complexContent> 
        </complexType> 
        <complexType name="ArrayOfString"> 
            <complexContent> 
                <restriction base="soapenc:Array"> 
                    <attribute ref="soapenc:arrayType" 
                               wsdl:arrayType="xsd:string[]"/> 
                </restriction> 
            </complexContent> 
        </complexType> 
    </schema> 
</wsdl:types> 
. 
. 
. 
<wsdl:message name="CustomerAO_arraySample"> 
    <part name="names"     type="S1:ArrayOfString"/> 
    <part name="hireDates” type="S1:ArrayOfDateTime"/> 
</wsdl:message> 
<wsdl:message name="CustomerAO_arraySampleResponse"> 
    <part name="quotas"    type="S1:ArrayOfInt"/> 
</wsdl:message> 

RPC/Literal

For the RPC/Literal format, an array parameter is represented as an unbounded sequence of its data type in an XML Schema type definition, where XMLType is the XML Schema type:

Array parameter definition for RPC/Literal WSDL
<complexType name="ArrayOfXMLType"> 
    <sequence> 
        <element name="item" type="XMLType" 
                       minOccurs="0" maxOccurs="unbounded"/> 
    </sequence> 
</complexType> 

The WSDL file contains a separate schema for each object defined in ProxyGen. Each such schema includes one complexType definition for each data type used as an array parameter for any procedure or function in that object. For example, if the 4GL defines one or more parameters in the object with the data type CHARACTER EXTENT, the schema includes a complexType named “ArrayOfString”.

The RPC/Literal WSDL document for the arraySample procedure shown at the beginning of this section includes the following types and message sections:

RPC/Literal WSDL schema example
<wsdl:types> 
    <schema targetNamespace="urn:tempuri-org:CustomerAO" 
            xmlns="http://www.w3.org/2001/XMLSchema" 
            elementFormDefault="unqualified" 
        <complexType name="ArrayOfInt"> 
            <sequence> 
                <element name="item" type="xsd:int"  
                               minOccurs="0" maxOccurs="unbounded"/> 
            </sequence> 
        </complexType> 
        <complexType name="ArrayOfDateTime"> 
            <sequence> 
                <element name="item" type="xsd:dateTime"  
                               minOccurs="0" maxOccurs="unbounded"/> 
            </sequence> 
        </complexType> 
        <complexType name="ArrayOfString"> 
            <sequence> 
                <element name="item" type="xsd:string"  
                               minOccurs="0" maxOccurs="unbounded"/> 
            </sequence> 
        </complexType> 
    </schema> 
</wsdl:types> 
<wsdl:message name="CustomerAO_arraySample"> 
    <part name="names"     type="S1:ArrayOfString"/> 
    <part name="hireDates" type="S1:ArrayOfDateTime"/> 
</wsdl:message> 
<wsdl:message name="CustomerAO_arraySampleResponse"> 
    <part name="quotas"    type="S1:ArrayOfInt"/> 
</wsdl:message> 

Document/Literal

For the Document/Literal format, an array parameter is represented as a sequence of its data type in an XML Schema type definition:

Array parameter definition for Document/Literal WSDL
<complexType 
    <sequence> 
        <element name="paramName" type="XMLType" 
                       minOccurs="zero_or_extentval" 
                       maxOccurs="extentval_or_unbounded"/> 
    </sequence> 
</complexType> 

The bolded elements refer to:

The Document/Literal WSDL document for the arraySample procedure shown at the beginning of this section includes the following types and message sections:

Document/Literal WSDL schema example
<wsdl:types> 
    <schema targetNamespace="urn:tempuri-org:CustomerAO" 
            xmlns="http://www.w3.org/2001/XMLSchema" 
            elementFormDefault="qualified"> 
        <element name="arraySample"> 
            <complexType> 
                <sequence> 
                    <element name="names"     type="xsd:string" 
                                   minOccurs="0" maxOccurs="unbounded" 
                                   nillable=”true”> 
                    <element name="hireDates" type="xsd:dateTime" 
                                   minOccurs="0" maxOccurs="unbounded" 
                                   nillable=”true”> 
                </sequence> 
            </complexType> 
        </element> 
        <element name="arraySampleResponse"> 
            <complexType> 
                <sequence> 
                    <element name="quotas"    type="xsd:int" 
                                   minOccurs="12" maxOccurs="12" 
                                   nillable=”true”> 
                </sequence> 
            </complexType> 
        </element> 
    </schema> 
</wsdl:types> 
<wsdl:message name="CustomerAO_procName"> 
    <part name="parameters" element="S1:procName"/> 
</wsdl:message> 
<wsdl:message name="CustomerAO_procNameResponse"> 
    <part name="parameters" element="S1:procNameResponse"/> 
</wsdl:message> 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095